﻿using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.Common;
using HumanManagement.BusinessObjects;
using HumanManagement.DataAccess;

namespace HumanManagement.BusinessLogic
{
	public class ProfessionalKnowledgeLevelBL
	{

		#region ***** Init Methods ***** 
		ProfessionalKnowledgeLevelDA objProfessionalKnowledgeLevelDA;
		public ProfessionalKnowledgeLevelBL()
		{
			objProfessionalKnowledgeLevelDA = new ProfessionalKnowledgeLevelDA();
		}
		#endregion

		#region ***** Get Methods ***** 
		/// <summary>
		/// Get ProfessionalKnowledgeLevel by id
		/// </summary>
		/// <param name="id">ID</param>
		/// <returns>ProfessionalKnowledgeLevel</returns>
		public ProfessionalKnowledgeLevel GetByID(int id)
		{
			return objProfessionalKnowledgeLevelDA.GetByID(id);
		}

		/// <summary>
		/// Get all of ProfessionalKnowledgeLevel
		/// </summary>
		/// <returns>List<<ProfessionalKnowledgeLevel>></returns>
		public List<ProfessionalKnowledgeLevel> GetList()
		{
			string cacheName = "lstProfessionalKnowledgeLevel";
			if( ServerCache.Get(cacheName) == null )
			{
				ServerCache.Insert(cacheName, objProfessionalKnowledgeLevelDA.GetList(), "ProfessionalKnowledgeLevel");
			}
			return (List<ProfessionalKnowledgeLevel>) ServerCache.Get(cacheName);
		}

		/// <summary>
		/// Get DataSet of ProfessionalKnowledgeLevel
		/// </summary>
		/// <returns>DataSet</returns>
		public DataSet GetDataSet()
		{
			string cacheName = "dsProfessionalKnowledgeLevel";
			if( ServerCache.Get(cacheName) == null )
			{
				ServerCache.Insert(cacheName, objProfessionalKnowledgeLevelDA.GetDataSet(), "ProfessionalKnowledgeLevel");
			}
			return (DataSet) ServerCache.Get(cacheName);
		}


		/// <summary>
		/// Get all of ProfessionalKnowledgeLevel paged
		/// </summary>
		/// <param name="recperpage">recperpage</param>
		/// <param name="pageindex">pageindex</param>
		/// <returns>List<<ProfessionalKnowledgeLevel>></returns>
		public List<ProfessionalKnowledgeLevel> GetListPaged(int recperpage, int pageindex)
		{
			return objProfessionalKnowledgeLevelDA.GetListPaged(recperpage, pageindex);
		}

		/// <summary>
		/// Get DataSet of ProfessionalKnowledgeLevel paged
		/// </summary>
		/// <param name="recperpage">recperpage</param>
		/// <param name="pageindex">pageindex</param>
		/// <returns>DataSet</returns>
		public DataSet GetDataSetPaged(int recperpage, int pageindex)
		{
			return objProfessionalKnowledgeLevelDA.GetDataSetPaged(recperpage, pageindex);
		}





		#endregion

		#region ***** Add Update Delete Methods ***** 
		/// <summary>
		/// Add a new ProfessionalKnowledgeLevel within ProfessionalKnowledgeLevel database table
		/// </summary>
		/// <param name="obj_professionalknowledgelevel">ProfessionalKnowledgeLevel</param>
		/// <returns>key of table</returns>
		public int Add(ProfessionalKnowledgeLevel obj_professionalknowledgelevel)
		{
			ServerCache.Remove("ProfessionalKnowledgeLevel", true);
			return objProfessionalKnowledgeLevelDA.Add(obj_professionalknowledgelevel);
		}

		/// <summary>
		/// updates the specified ProfessionalKnowledgeLevel
		/// </summary>
		/// <param name="obj_professionalknowledgelevel">ProfessionalKnowledgeLevel</param>
		/// <returns></returns>
		public void Update(ProfessionalKnowledgeLevel obj_professionalknowledgelevel)
		{
			ServerCache.Remove("ProfessionalKnowledgeLevel", true);
			objProfessionalKnowledgeLevelDA.Update(obj_professionalknowledgelevel);
		}

		/// <summary>
		/// Delete the specified ProfessionalKnowledgeLevel
		/// </summary>
		/// <param name="id">ID</param>
		/// <returns></returns>
		public void Delete(int id)
		{
			ServerCache.Remove("ProfessionalKnowledgeLevel", true);
			objProfessionalKnowledgeLevelDA.Delete(id);
		}
		#endregion
	}
}
